/* source/core/sgl_task.h
 *
 * MIT License
 *
 * Copyright(c) 2023-present All contributors of SGL  
 *  
 * Email: 1477153217@qq.com
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

#ifndef __SGL_TASK_H__
#define __SGL_TASK_H__

#include "./sgl_core.h"

#ifdef __cplusplus
extern "C" {
#endif


/**
 * @brief check if the task queue is empty
 * 
 * @param none
 * 
 * @return bool: true is empty, false is not empty
*/
bool sgl_task_queue_is_empty(void);


/**
 * @brief check  if the task queue is full
 * 
 * @param none
 * 
 * @return bool: true is full, false is not full
*/
bool sgl_task_queue_is_full(void);


/**
 * @brief Push a new task into the task queue
 * 
 * @param task: The task to be pushed
 * 
 * @return none
*/
void sgl_task_queue_push(sgl_task_t task);


/**
 * @brief Pop up a task from the task queue
 * 
 * @param none
 * 
 * @return sgl_task_t: Pop up tasks
*/
sgl_task_t sgl_task_queue_pop(void);


/**
 * @brief Clear all tasks in the task queue
 * 
 * @param none
 * 
 * @return none
*/
void sgl_task_queue_clear(void);


#ifdef __cplusplus
} /*extern "C"*/
#endif

#endif //__SGL_TASK_H__
